reallocate the required memory block, rather than allocating it newly from
authorTim Janik <timj@gtk.org>
Mon, 21 Sep 1998 06:14:18 +0000 (06:14 +0000)
committerTim Janik <timj@src.gnome.org>
Mon, 21 Sep 1998 06:14:18 +0000 (06:14 +0000)
Mon Sep 21 07:44:30 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
        the required memory block, rather than allocating it newly from
        scratch and doing a full-blown block copy on it.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkobject.c

index 419e5c4dc896c84444d85c45c06437b026b1c3e2..e43dce19ed6c4d10648b07e612f7ac96b1b7b3b3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Sep 21 07:44:30 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
+       the required memory block, rather than allocating it newly from
+       scratch and doing a full-blown block copy on it.
+
 Mon Sep 21 02:30:06 1998  Tim Janik  <timj@gtk.org>
 
         * NEWS file update for upcoming release of Gtk+ version 1.1.2,
index 419e5c4dc896c84444d85c45c06437b026b1c3e2..e43dce19ed6c4d10648b07e612f7ac96b1b7b3b3 100644 (file)
@@ -1,3 +1,9 @@
+Mon Sep 21 07:44:30 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
+       the required memory block, rather than allocating it newly from
+       scratch and doing a full-blown block copy on it.
+
 Mon Sep 21 02:30:06 1998  Tim Janik  <timj@gtk.org>
 
         * NEWS file update for upcoming release of Gtk+ version 1.1.2,
index 419e5c4dc896c84444d85c45c06437b026b1c3e2..e43dce19ed6c4d10648b07e612f7ac96b1b7b3b3 100644 (file)
@@ -1,3 +1,9 @@
+Mon Sep 21 07:44:30 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
+       the required memory block, rather than allocating it newly from
+       scratch and doing a full-blown block copy on it.
+
 Mon Sep 21 02:30:06 1998  Tim Janik  <timj@gtk.org>
 
         * NEWS file update for upcoming release of Gtk+ version 1.1.2,
index 419e5c4dc896c84444d85c45c06437b026b1c3e2..e43dce19ed6c4d10648b07e612f7ac96b1b7b3b3 100644 (file)
@@ -1,3 +1,9 @@
+Mon Sep 21 07:44:30 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
+       the required memory block, rather than allocating it newly from
+       scratch and doing a full-blown block copy on it.
+
 Mon Sep 21 02:30:06 1998  Tim Janik  <timj@gtk.org>
 
         * NEWS file update for upcoming release of Gtk+ version 1.1.2,
index 419e5c4dc896c84444d85c45c06437b026b1c3e2..e43dce19ed6c4d10648b07e612f7ac96b1b7b3b3 100644 (file)
@@ -1,3 +1,9 @@
+Mon Sep 21 07:44:30 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
+       the required memory block, rather than allocating it newly from
+       scratch and doing a full-blown block copy on it.
+
 Mon Sep 21 02:30:06 1998  Tim Janik  <timj@gtk.org>
 
         * NEWS file update for upcoming release of Gtk+ version 1.1.2,
index 419e5c4dc896c84444d85c45c06437b026b1c3e2..e43dce19ed6c4d10648b07e612f7ac96b1b7b3b3 100644 (file)
@@ -1,3 +1,9 @@
+Mon Sep 21 07:44:30 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
+       the required memory block, rather than allocating it newly from
+       scratch and doing a full-blown block copy on it.
+
 Mon Sep 21 02:30:06 1998  Tim Janik  <timj@gtk.org>
 
         * NEWS file update for upcoming release of Gtk+ version 1.1.2,
index 419e5c4dc896c84444d85c45c06437b026b1c3e2..e43dce19ed6c4d10648b07e612f7ac96b1b7b3b3 100644 (file)
@@ -1,3 +1,9 @@
+Mon Sep 21 07:44:30 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
+       the required memory block, rather than allocating it newly from
+       scratch and doing a full-blown block copy on it.
+
 Mon Sep 21 02:30:06 1998  Tim Janik  <timj@gtk.org>
 
         * NEWS file update for upcoming release of Gtk+ version 1.1.2,
index af023f0c38304e8d50bea90f215dd23e47dc4270..6639830a253973feafbcbed8489d46d2fe2de6f4 100644 (file)
@@ -127,7 +127,7 @@ gtk_object_get_type (void)
 static void
 gtk_object_base_class_init (GtkObjectClass *class)
 {
-  /* reset instance specific fields that don't get inhrited */
+  /* reset instance specific fields that don't get inherited */
   class->signals = NULL;
   class->nsignals = 0;
   class->n_args = 0;
@@ -327,19 +327,13 @@ gtk_object_class_add_signals (GtkObjectClass *class,
                              guint          *signals,
                              guint           nsignals)
 {
-  guint *new_signals;
-  guint i;
-
-  g_return_if_fail (class != NULL);
-
-  new_signals = g_new (guint, class->nsignals + nsignals);
-  for (i = 0; i < class->nsignals; i++)
-    new_signals[i] = class->signals[i];
-  for (i = 0; i < nsignals; i++)
-    new_signals[class->nsignals + i] = signals[i];
-
-  g_free (class->signals);
-  class->signals = new_signals;
+  g_return_if_fail (GTK_IS_OBJECT_CLASS (class));
+  if (!nsignals)
+    return;
+  g_return_if_fail (signals != NULL);
+  
+  class->signals = g_renew (guint, class->signals, class->nsignals + nsignals);
+  memcpy (class->signals + class->nsignals, signals, nsignals * sizeof (guint));
   class->nsignals += nsignals;
 }